package com.happyclub.pojo;

import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * @author 高欢
 * @description 用户意见反馈表
 * @date 2019/4/4
 */
@Entity
@Table(name = "TB_USER_ADVICE", schema = "SCOTT")
@EntityListeners(AuditingEntityListener.class)
public class TbUserAdvice implements Serializable {
    private String id;
    private String advice;
    private String userId;
    private Long doStatus;
    private Long shenHeStatus;
    private String contactWay;
    private Long isUpperTracker;
    private Long infoLevel;
    private Date updateTime;
    private Date createTime;

    private TbUser user;

    @Transient
    public TbUser getUser() {
        return user;
    }

    public void setUser(TbUser user) {
        this.user = user;
    }

    @Id
    @Column(name = "ID")
    @GenericGenerator(name="idGenerator", strategy="uuid") //这个是hibernate的注解/生成32位UUID
    @GeneratedValue(generator="idGenerator")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "ADVICE")
    public String getAdvice() {
        return advice;
    }

    public void setAdvice(String advice) {
        this.advice = advice;
    }

    @Basic
    @Column(name = "USER_ID")
    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "DO_STATUS")
    public Long getDoStatus() {
        return doStatus;
    }

    public void setDoStatus(Long doStatus) {
        this.doStatus = doStatus;
    }

    @Basic
    @Column(name = "SHEN_HE_STATUS")
    public Long getShenHeStatus() {
        return shenHeStatus;
    }

    public void setShenHeStatus(Long shenheStatus) {
        this.shenHeStatus = shenheStatus;
    }

    @Basic
    @Column(name = "CONTACT_WAY")
    public String getContactWay() {
        return contactWay;
    }

    public void setContactWay(String contactWay) {
        this.contactWay = contactWay;
    }


    @Basic
    @Column(name = "IS_UPPER_TRACKER")
    public Long getIsUpperTracker() {
        return isUpperTracker;
    }

    public void setIsUpperTracker(Long isUpperTracker) {
        this.isUpperTracker = isUpperTracker;
    }

    @Basic
    @Column(name = "INFO_LEVEL")
    public Long getInfoLevel() {
        return infoLevel;
    }

    public void setInfoLevel(Long infoLevel) {
        this.infoLevel = infoLevel;
    }

    @Basic
    @Column(name = "UPDATE_TIME")
    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "CREATE_TIME")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TbUserAdvice that = (TbUserAdvice) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(advice, that.advice) &&
                Objects.equals(userId, that.userId) &&
                Objects.equals(doStatus, that.doStatus) &&
                Objects.equals(shenHeStatus, that.shenHeStatus) &&
                Objects.equals(contactWay, that.contactWay) &&
                Objects.equals(isUpperTracker, that.isUpperTracker) &&
                Objects.equals(infoLevel, that.infoLevel) &&
                Objects.equals(updateTime, that.updateTime) &&
                Objects.equals(createTime, that.createTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, advice, userId, doStatus, shenHeStatus, contactWay, isUpperTracker, infoLevel, updateTime, createTime);
    }
}
